﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;

namespace nwrole.lib {
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)]
    [CallbackBehavior(ConcurrencyMode = ConcurrencyMode.Reentrant)]
    public class OrchestratorClient : IOrchestratorClientContract {
        private ISupervisorContract supervisor;

        public OrchestratorClient(ISupervisorContract supervisor) {
            this.supervisor = supervisor;
        }

        /*public int GetNumServices() {
            return supervisor.GetNumServices();
        }*/

        /*public Guid GetIdentifier() {
            return supervisor.GetIdentifier();
        }*/

        public Result Start()
        {
            return supervisor.Start();
        }

        public Result Stop()
        {
            return supervisor.Stop();
        }

        public SupervisorData GetSupervisorData() {
            return supervisor.GetSupervisorData();
        }

        public ServiceData[] GetServices() {
            return supervisor.GetServices();
        }

        public Result RestartService(Guid serviceId)
        {
            return supervisor.RestartService(serviceId);
        }

        public Result StopService(Guid serviceId)
        {
            return supervisor.StopService(serviceId);
        }

        public Result StartService(Guid serviceId)
        {
            return supervisor.StartService(serviceId);
        }

        public PluginData[] GetServicePluginsData(Guid serviceId)
        {
            return supervisor.GetServicePluginsData(serviceId);
        }

        public PluginState? GetServicePluginState(Guid serviceId, Guid pluginId)
        {
            return supervisor.GetServicePluginState(serviceId, pluginId);
        }
        
    }
}
